package com.alan.boot.mongo.controller;

import com.alan.boot.mongo.service.FormNoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("/formNo")
@RestController
public class FormNoController {
    @Resource
    private FormNoService formNoService;

    // curl http://localhost:8080/formNo/getLatestCount?formatter=ht-01
    @RequestMapping("/getLatestCount")
    public Long getLatestCount(@RequestParam String formatter) {
        return formNoService.getLatestCount(formatter);
    }


}
